package com.test.service.impl;

import com.test.dao.ITemperaturepanelHistoricalDao;
import com.test.model.TemperaturePanelCurrentData;
import com.test.model.TemperaturePanelHistoricalData;
import com.test.service.ITemperaturePanelHistoricalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by ZZF on 2017/7/12.
 */
@Service
public class TemperaturePenalHistoricalServiceImpl implements ITemperaturePanelHistoricalService {

    @Autowired
    ITemperaturepanelHistoricalDao temperaturepanelHistoricalDao;

    @Override
    public void addHistorical(TemperaturePanelCurrentData temperaturePanelCurrentData) {

        if (temperaturePanelCurrentData!=null) {
            TemperaturePanelHistoricalData temperaturePanelHistoricalData = new TemperaturePanelHistoricalData();
            temperaturePanelHistoricalData.setPlanTime(temperaturePanelCurrentData.getPlanTime());
            temperaturePanelHistoricalData.setTemperaturePanelId(temperaturePanelCurrentData.getTemperaturePanelId());
            temperaturePanelHistoricalData.setTemperature(temperaturePanelCurrentData.getTemperature());

            temperaturepanelHistoricalDao.save(temperaturePanelHistoricalData);

        }

    }


}
